{% extends "nmapreport/main.html" %}

{% block content %}
	<div class="container" style="margin-top:30px;">
		<div class="row">
			<div class="col s12 m3">
				<div class="card darken-1">
					<div class="card-content grey darken-3 white-text">
						<span class="card-title"><i class="fas fa-file-code"></i> {{ stats.xmlcount }}</span>
						<p>XML文件</p>
					</div>
				</div>
			</div>
			<div class="col s12 m3">
				<div class="card darken-1">
					<div class="card-content green darken-1 white-text">
						<span class="card-title"><i class="fas fa-door-open"></i> {{ stats.po }}</span>
						<p>启动的端口</p>
					</div>
				</div>
			</div>
			<div class="col s12 m3">
				<div class="card darken-1">
					<div class="card-content red darken-1 white-text">
						<span class="card-title"><i class="fas fa-door-closed"></i> {{ stats.pc }}</span>
						<p>关闭的端口</p>
					</div>
				</div>
			</div>
			<div class="col s12 m3">
				<div class="card darken-1">
					<div class="card-content grey darken-1 white-text">
						<span class="card-title"><i class="fas fa-filter"></i> {{ stats.pf }}</span>
						<p>过滤的端口</p>
					</div>
				</div>
			</div>
		</div>

		<div class="card wmcard">
		<div class="card-content">
		<table>
			<thead><tr>
				<th>文件名</th>
				<th class="hide-on-small-only">执行时间</th>
				<th class="hide-on-small-only">Host数</th>
				<th>状态</th>
			</tr></thead>
			<tbody>
				{% for i,v in tr.items %}
					<tr>
						<td><b><a class="blue-text" href="{{ v.href }}">{{ v.filename|safe }}</a></b></td>
						<td class="hide-on-small-only"><code>{{ v.startstr }}</code></td>
						<td class="hide-on-small-only">{{ v.hostnum }}</td>
						<td>
							<i class="fas fa-door-open green-text"></i><span class="green-text">{{ v.portstats.po }}</span> 
							<i class="fas fa-door-closed red-text"></i><span class="red-text">{{ v.portstats.pc }}</span>
							<i class="fas fa-filter grey-text"></i><span class="grey-text">{{ v.portstats.pf }}</span>
						</td>
					</tr>
				{% endfor %}
			</tbody>
		</table>
		</div>
		<!-- <div class="card-action">
			<a href="#!" onclick="javascript:newscan();" class="valign-wrapper blue-text"><i class="material-icons">wifi_tethering</i> &nbsp; New Nmap Scan</a>
		</div> -->
		</div>

		<div class="card" id="activescancard" style="display:none;">
			<div class="card-content">
				<b>Active Scan</b><br><br>
				<div id="activescan">
				</div>
			</div>
		</div>

		<br><br>
		<div class="small grey-text">
			{{ webmapver|safe }}
		</div>

	</div>
{% endblock %}
